﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fuzzy
{
    public partial class deleteform : Form
    {
        public deleteform()
        {
            InitializeComponent();
        }

        //FUNCTION TO GET REFRENCE OF MAIN FORM
        public void setMainForm(main refrence)
        {
            mainform = refrence;
        }

        private void deletename_textbox_TextChanged(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(deletename_textbox.Text.ToString()))
                delete_button.Enabled = false;
            else
                delete_button.Enabled = true;

        }

        private void delete_button_Click(object sender, EventArgs e)
        {
            mainform.xmlFile.deletedata(deletename_textbox.Text.ToString());
        }

        private void main_button_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainform.Enabled = true;
            mainform.BringToFront();
        }

       
    }
}
